package org.grayrabbit.cms.entity;

// Generated 2011-5-16 13:39:30 by Hibernate Tools 3.3.0.GA

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

/**
 * CmsSurvey generated by hbm2java
 */
@Entity
@Table(name = "CMS_SURVEY")
public class Survey implements java.io.Serializable {

	private static final long serialVersionUID = -312937220287461104L;
	private String surveyId;
	private String surveyTitle;
	private Date startTime;
	private Boolean surveyStatus;
	private Boolean surveyRepeatSubmitStatus;
	private String updateRealName;
	private String updateLoginName;
	private Date createTime;
	private String createRealName;
	private String createLoginName;
	private Date updateTime;
	private Date endTime;
	private String memo;
	private Integer joinTotal;
	private Integer intervalTime;
	private Site site;
	private Integer ord;
	private Set<SurveyRecord> surveyRecords = new HashSet<SurveyRecord>(
			0);
	private Set<SurveySubject> surveySubjects = new HashSet<SurveySubject>(
			0);

	public Survey() {
	}

	public Survey(String surveyId) {
		this.surveyId = surveyId;
	}

	@Id
	@Column(name = "SURVEY_ID", unique = true, nullable = false, length = 32)
	@GeneratedValue(generator = "paymentableGenerator")       
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid") 
	public String getSurveyId() {
		return this.surveyId;
	}

	public void setSurveyId(String surveyId) {
		this.surveyId = surveyId;
	}

	@Column(name = "SURVEY_TITLE", length = 256)
	public String getSurveyTitle() {
		return this.surveyTitle;
	}

	public void setSurveyTitle(String surveyTitle) {
		this.surveyTitle = surveyTitle;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "START_TIME", length = 7)
	public Date getStartTime() {
		return this.startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	@Column(name = "SURVEY_STATUS", precision = 1, scale = 0)
	public Boolean getSurveyStatus() {
		return this.surveyStatus;
	}

	public void setSurveyStatus(Boolean surveyStatus) {
		this.surveyStatus = surveyStatus;
	}

	@Column(name = "SURVEY_REPEAT_SUBMIT_STATUS", precision = 1, scale = 0)
	public Boolean getSurveyRepeatSubmitStatus() {
		return this.surveyRepeatSubmitStatus;
	}

	public void setSurveyRepeatSubmitStatus(Boolean surveyRepeatSubmitStatus) {
		this.surveyRepeatSubmitStatus = surveyRepeatSubmitStatus;
	}

	@Column(name = "UPDATE_REAL_NAME", length = 64)
	public String getUpdateRealName() {
		return this.updateRealName;
	}

	public void setUpdateRealName(String updateRealName) {
		this.updateRealName = updateRealName;
	}

	@Column(name = "UPDATE_LOGIN_NAME", length = 64)
	public String getUpdateLoginName() {
		return this.updateLoginName;
	}

	public void setUpdateLoginName(String updateLoginName) {
		this.updateLoginName = updateLoginName;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_TIME", length = 7)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "CREATE_REAL_NAME", length = 64)
	public String getCreateRealName() {
		return this.createRealName;
	}

	public void setCreateRealName(String createRealName) {
		this.createRealName = createRealName;
	}

	@Column(name = "CREATE_LOGIN_NAME", length = 64)
	public String getCreateLoginName() {
		return this.createLoginName;
	}

	public void setCreateLoginName(String createLoginName) {
		this.createLoginName = createLoginName;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UPDATE_TIME", length = 7)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "END_TIME", length = 7)
	public Date getEndTime() {
		return this.endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	@Column(name = "MEMO", length = 256)
	public String getMemo() {
		return this.memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	@Column(name = "JOIN_TOTAL", precision = 6, scale = 0)
	public Integer getJoinTotal() {
		return this.joinTotal;
	}

	public void setJoinTotal(Integer joinTotal) {
		this.joinTotal = joinTotal;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "survey")
	public Set<SurveyRecord> getSurveyRecords() {
		return surveyRecords;
	}

	public void setSurveyRecords(Set<SurveyRecord> surveyRecords) {
		this.surveyRecords = surveyRecords;
	}
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "survey")
	public Set<SurveySubject> getSurveySubjects() {
		return surveySubjects;
	}

	public void setSurveySubjects(Set<SurveySubject> surveySubjects) {
		this.surveySubjects = surveySubjects;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SITE_ID")
	public Site getSite() {
		return site;
	}

	public void setSite(Site site) {
		this.site = site;
	}
	@Column(name = "INTERVAL_TIME", precision = 6, scale = 0)
	public Integer getIntervalTime() {
		return intervalTime;
	}

	public void setIntervalTime(Integer intervalTime) {
		this.intervalTime = intervalTime;
	}

	@Column(name = "ORD", precision = 6, scale = 0)
	public Integer getOrd() {
		return ord;
	}

	public void setOrd(Integer ord) {
		this.ord = ord;
	}
	
}
